﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace IGolovkine.AoA.Tests
{
    /// <summary>
    /// Summary description for CorrelationId
    /// </summary>
    [TestClass]
    public class CorrelationIdTests
    {
        [TestMethod]
        public void Spec()
        {
            CorrelationId id1 = CorrelationId.Next();
            CorrelationId id2 = CorrelationId.Next();

            CorrelationId id1copy = id1;
            CorrelationId idNull = default(CorrelationId);

            Assert.AreNotEqual(id1, id2);
            Assert.AreEqual(id1, id1copy);
            Assert.IsTrue(id1 == id1copy);
            Assert.IsTrue(id1 != id2);

            AssertEx.Throws<ArgumentException>(() => { bool a = idNull == id1; });
            AssertEx.Throws<ArgumentException>(() => { bool b = idNull != id1; });
            AssertEx.Throws<ArgumentException>(() => { bool b = idNull.Equals(id1); });
            AssertEx.Throws<ArgumentException>(() => { bool b = id1.Equals(idNull); });
        }
    }
}
